{% set base = url('addons.ratings.list', addon.slug) %}
{% if collection_uuid %}
    {% set base = base|urlparams(collection_uuid=collection_uuid) %}
{% endif %}

<p class="addon-rating">
  {% with num=addon.total_ratings %}
    {% if num %}
    {{ addon.average_rating|float|stars }}
    {% with count='<span itemprop="count">{0}</span>'|format_html(num|numberfmt) %}
      {# Using num=count so we don't change an L10n string. #}
      <a href="{{ base|absolutify }}"><strong>{{
        ngettext('{num} review', '{num} reviews', num)|format_html(num=count)
      }}</strong></a>
    {% endwith %}
    {% else %}
      <strong>{{ _('Not yet rated') }}</strong>
    {% endif %}
  {% endwith %}
</p>
